/*
** Copyright (C) 2010 Calin Radoni
**
** This file is part of CHScanner.
**
** CHScanner is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** CHScanner is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with CHScanner. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "MT19937.h"
#include "MimicInfo.h"

class MimicInfoPack
{
private:
	MT19937 rnd;

	MimicOS   mimicOS;
	MimicInfo model;
	MimicInfo value;

	WORD sharedVal;

	WORD InitWordValue(WORD);
	WORD IncrWordValue(WORD, WORD*);
	bool WordValueIsInLimits(WORD);

	WORD GetRandomPort(void);
	WORD GetIncrPort(void);
	void ComputeSourcePort(bool);

	bool firstValue;

	void Initialize(void);

public:
	MimicInfoPack(void);
	~MimicInfoPack(void);

	void Set(MimicOS);
	MimicOS GetMimic(void);

	void GetNewSet(MimicInfo*, MimicInfoIpProtocol);
	void GetNewSet6(MimicInfo*, MimicInfoIpProtocol);

	BYTE GetIgmpMaxResponseTime(void);
};
